﻿                <span id="currenttimeshow"></span>
                <script type="text/javascript">
                    function updateCurrentTimeShow() {
                        var date = new Date();
                        var d = date.getDate();
                        var m = date.getMonth() + 1;
                        var y = date.getFullYear();
                        //var W = (d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) % 7;
                        var weekS = "星期一";
                        switch (date.getDay()) {
                            case 1:
                                weekS = "星期一";
                                break;
                            case 2:
                                weekS = "星期二";
                                break;
                            case 3:
                                weekS = "星期三";
                                break;
                            case 4:
                                weekS = "星期四";
                                break;
                            case 5:
                                weekS = "星期五";
                                break;
                            case 6:
                                weekS = "星期六";
                                break;
                            default:
                                weekS = "星期日";
                                break;

                        }
                        var msg = "当前时间" + y + "年" + m + "月" + d + "日 "
                        + date.getHours() + "点" + date.getMinutes() + "分，" + weekS;
                        $("#currenttimeshow").text(msg);
                    }
                    $(function () {
                        updateCurrentTimeShow();
                        setInterval(updateCurrentTimeShow, 30000);
                    });
                </script>